<%-- 
    Document   : UserFrom
    Created on : 11-oct-2011, 0:21:01
    Author     : TOSHIBA
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@page import="edu.upeu.examlp1.comm.Conexion" %>
<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
String UserId=request.getParameter("userId");
String name="";
String email="";
String cellular="";
        Conexion conn = new Conexion();
        try {           
            String qry="select * from User where UserId=?";
            PreparedStatement ps=conn.getConnection().prepareStatement(qry);
            ps.setString(1, UserId);
            ResultSet rs= ps.executeQuery();
            if(rs.next())
                name=rs.getString("Name");
                email=rs.getString("Email");
                cellular=rs.getString("celular");
            conn.close();
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
%>               
        <form action="UserSave.jsp">
            <br> <input type="hidden" name="go" value="Edit">
            <br>UserId <input type="text" name="userId" value="<%=UserId%>" readonly="true">
            <br>Name: <input type="text" name="name" value="<%=name%>">
            <br>Email:<input type="text" name="email" value="<%=email%>">
            <br>Cellular:<input type="text" name="email" value="<%=cellular%>">
            <br><input type="submit">
        </form>
    </body>
</html>